// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*!
 * @file DdsRecorderStatus.cxx
 * This source file contains the definition of the described types in the IDL file.
 *
 * This file was generated by the tool gen.
 */

#ifdef _WIN32
// Remove linker warning LNK4221 on Visual Studio
namespace {
char dummy;
}  // namespace
#endif  // _WIN32

#include "DdsRecorderStatus.h"
#include <fastcdr/Cdr.h>

#include <fastcdr/exceptions/BadParamException.h>
using namespace eprosima::fastcdr::exception;

#include <utility>

#define DdsRecorderStatus_max_cdr_typesize 780ULL;
#define DdsRecorderStatus_max_key_cdr_typesize 0ULL;

DdsRecorderStatus::DdsRecorderStatus()
{
    // string m_previous
    m_previous ="";
    // string m_current
    m_current ="";
    // string m_info
    m_info ="";

}

DdsRecorderStatus::~DdsRecorderStatus()
{



}

DdsRecorderStatus::DdsRecorderStatus(
        const DdsRecorderStatus& x)
{
    m_previous = x.m_previous;
    m_current = x.m_current;
    m_info = x.m_info;
}

DdsRecorderStatus::DdsRecorderStatus(
        DdsRecorderStatus&& x) noexcept
{
    m_previous = std::move(x.m_previous);
    m_current = std::move(x.m_current);
    m_info = std::move(x.m_info);
}

DdsRecorderStatus& DdsRecorderStatus::operator =(
        const DdsRecorderStatus& x)
{

    m_previous = x.m_previous;
    m_current = x.m_current;
    m_info = x.m_info;

    return *this;
}

DdsRecorderStatus& DdsRecorderStatus::operator =(
        DdsRecorderStatus&& x) noexcept
{

    m_previous = std::move(x.m_previous);
    m_current = std::move(x.m_current);
    m_info = std::move(x.m_info);

    return *this;
}

bool DdsRecorderStatus::operator ==(
        const DdsRecorderStatus& x) const
{

    return (m_previous == x.m_previous && m_current == x.m_current && m_info == x.m_info);
}

bool DdsRecorderStatus::operator !=(
        const DdsRecorderStatus& x) const
{
    return !(*this == x);
}

size_t DdsRecorderStatus::getMaxCdrSerializedSize(
        size_t current_alignment)
{
    static_cast<void>(current_alignment);
    return DdsRecorderStatus_max_cdr_typesize;
}

size_t DdsRecorderStatus::getCdrSerializedSize(
        const DdsRecorderStatus& data,
        size_t current_alignment)
{
    (void)data;
    size_t initial_alignment = current_alignment;


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.previous().size() + 1;

    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.current().size() + 1;

    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.info().size() + 1;


    return current_alignment - initial_alignment;
}

void DdsRecorderStatus::serialize(
        eprosima::fastcdr::Cdr& scdr) const
{

    scdr << m_previous.c_str();
    scdr << m_current.c_str();
    scdr << m_info.c_str();

}

void DdsRecorderStatus::deserialize(
        eprosima::fastcdr::Cdr& dcdr)
{

    dcdr >> m_previous;
    dcdr >> m_current;
    dcdr >> m_info;
}

/*!
 * @brief This function copies the value in member previous
 * @param _previous New value to be copied in member previous
 */
void DdsRecorderStatus::previous(
        const std::string& _previous)
{
    m_previous = _previous;
}

/*!
 * @brief This function moves the value in member previous
 * @param _previous New value to be moved in member previous
 */
void DdsRecorderStatus::previous(
        std::string&& _previous)
{
    m_previous = std::move(_previous);
}

/*!
 * @brief This function returns a constant reference to member previous
 * @return Constant reference to member previous
 */
const std::string& DdsRecorderStatus::previous() const
{
    return m_previous;
}

/*!
 * @brief This function returns a reference to member previous
 * @return Reference to member previous
 */
std::string& DdsRecorderStatus::previous()
{
    return m_previous;
}
/*!
 * @brief This function copies the value in member current
 * @param _current New value to be copied in member current
 */
void DdsRecorderStatus::current(
        const std::string& _current)
{
    m_current = _current;
}

/*!
 * @brief This function moves the value in member current
 * @param _current New value to be moved in member current
 */
void DdsRecorderStatus::current(
        std::string&& _current)
{
    m_current = std::move(_current);
}

/*!
 * @brief This function returns a constant reference to member current
 * @return Constant reference to member current
 */
const std::string& DdsRecorderStatus::current() const
{
    return m_current;
}

/*!
 * @brief This function returns a reference to member current
 * @return Reference to member current
 */
std::string& DdsRecorderStatus::current()
{
    return m_current;
}
/*!
 * @brief This function copies the value in member info
 * @param _info New value to be copied in member info
 */
void DdsRecorderStatus::info(
        const std::string& _info)
{
    m_info = _info;
}

/*!
 * @brief This function moves the value in member info
 * @param _info New value to be moved in member info
 */
void DdsRecorderStatus::info(
        std::string&& _info)
{
    m_info = std::move(_info);
}

/*!
 * @brief This function returns a constant reference to member info
 * @return Constant reference to member info
 */
const std::string& DdsRecorderStatus::info() const
{
    return m_info;
}

/*!
 * @brief This function returns a reference to member info
 * @return Reference to member info
 */
std::string& DdsRecorderStatus::info()
{
    return m_info;
}


size_t DdsRecorderStatus::getKeyMaxCdrSerializedSize(
        size_t current_alignment)
{
    static_cast<void>(current_alignment);
    return DdsRecorderStatus_max_key_cdr_typesize;
}

bool DdsRecorderStatus::isKeyDefined()
{
    return false;
}

void DdsRecorderStatus::serializeKey(
        eprosima::fastcdr::Cdr& scdr) const
{
    (void) scdr;
}
